package com.falm.cli.command;

import picocli.CommandLine;

import java.util.concurrent.Callable;

/**
 * @author Administrator
 */
@CommandLine.Command(name = "falm", version = "generate 1.0", mixinStandardHelpOptions = true)
public class CommandExecutor implements Callable<Integer> {

    private final CommandLine commandLine;

    {
        commandLine = new CommandLine(this)
                .addSubcommand("generate", new GenerateCommand())
                .addSubcommand("list", new ListCommand())
                .addSubcommand("config", new ConfigCommand());
    }

    @Override
    public Integer call() throws Exception {
        return 0;
    }

    public Integer doExecutor(String[] args) {
        return commandLine.execute(args);
    }
}
